package com.skyjing.astools

import android.os.Bundle
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import com.skyjing.askit.AsText2Speech
import kotlinx.android.synthetic.main.activity_main.*
import java.util.*

class SpeechActivity : AppCompatActivity(R.layout.activity_main),View.OnClickListener {

    override fun onClick(v: View?) {
        when(v?.id){
            R.id.btnDownload->{
                AsText2Speech.speechAdd("9527")
            }
            R.id.btnDownloadkt->{
//                AsText2Speech.setLanguage(Locale.US)
            }
        }
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        AsText2Speech.init(this , Locale.KOREA)
        btnDownload.text = "播放语音"
        btnDownload.setOnClickListener(this)
        btnDownloadkt.text = "更改语言"
        btnDownloadkt.setOnClickListener(this)
    }

}